package com.example.demo1.Demo2;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;

@Service
public class UseService {

    @Primary
    @Bean("user1")
    public void sayhi(){
        System.out.println("hi");
    }

    @Bean("user2")
    public void sayhello(){
        System.out.println("hello");
    }
}
